package com.yuchen.bearrecord.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.LinkedHashSet;
import java.util.Set;

@Getter
@Setter
@Entity
@Table(name = "user")
public class User implements Serializable {
    @Id
    @Column(name = "openid", nullable = false)
    private String openid;

    @Column(name = "appid", nullable = false)
    private String appid;

    @Column(name = "createtime")
    private Timestamp createtime;

    @Column(name = "type", nullable = false)
    private Integer type;

    @OneToMany(mappedBy = "user")
    private Set<Drug> drugs = new LinkedHashSet<>();

}
